<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>二维码扫描测试</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            background: #f5f5f5;
        }
        .container {
            background: white;
            padding: 30px;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        h1 {
            text-align: center;
            color: #333;
            margin-bottom: 30px;
        }
        .test-section {
            margin-bottom: 40px;
            padding: 20px;
            border: 1px solid #ddd;
            border-radius: 8px;
        }
        .test-title {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 15px;
            color: #555;
        }
        .qr-container {
            text-align: center;
            margin: 20px 0;
        }
        .test-info {
            background: #e8f4fd;
            padding: 15px;
            border-radius: 5px;
            margin-bottom: 15px;
            border-left: 4px solid #2196F3;
        }
        button {
            background: #4CAF50;
            color: white;
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            margin: 5px;
        }
        button:hover {
            background: #45a049;
        }
        .instructions {
            background: #fff3cd;
            border: 1px solid #ffeaa7;
            padding: 15px;
            border-radius: 5px;
            margin-top: 20px;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>🔍 二维码扫描测试</h1>
        
        <div class="instructions">
            <h3>📱 测试说明：</h3>
            <p>1. 点击下方按钮生成不同类型的二维码</p>
            <p>2. 使用微信扫一扫、支付宝扫码或其他扫码工具测试</p>
            <p>3. 验证二维码是否能被正确识别和扫描</p>
        </div>
        
        <div class="test-section">
            <div class="test-title">测试1: 简单文本</div>
            <div class="test-info">
                <strong>测试内容：</strong>Hello World!
            </div>
            <div class="qr-container" id="qr1"></div>
            <button onclick="generateTest1()">生成文本二维码</button>
        </div>
        
        <div class="test-section">
            <div class="test-title">测试2: 网址链接</div>
            <div class="test-info">
                <strong>测试内容：</strong>https://www.baidu.com
            </div>
            <div class="qr-container" id="qr2"></div>
            <button onclick="generateTest2()">生成网址二维码</button>
        </div>
        
        <div class="test-section">
            <div class="test-title">测试3: 中文内容</div>
            <div class="test-info">
                <strong>测试内容：</strong>你好，世界！这是一个中文二维码测试。
            </div>
            <div class="qr-container" id="qr3"></div>
            <button onclick="generateTest3()">生成中文二维码</button>
        </div>
        
        <div class="test-section">
            <div class="test-title">测试4: 联系信息</div>
            <div class="test-info">
                <strong>测试内容：</strong>MECARD:N:张三;TEL:13800138000;EMAIL:zhangsan@example.com;;
            </div>
            <div class="qr-container" id="qr4"></div>
            <button onclick="generateTest4()">生成联系人二维码</button>
        </div>
        
        <div class="test-section">
            <div class="test-title">测试5: WiFi信息</div>
            <div class="test-info">
                <strong>测试内容：</strong>WIFI:T:WPA;S:MyWiFi;P:password123;;
            </div>
            <div class="qr-container" id="qr5"></div>
            <button onclick="generateTest5()">生成WiFi二维码</button>
        </div>
    </div>
    
    <script src="qrcode.min.js"></script>
    <script>
        function generateTest1() {
            const container = document.getElementById('qr1');
            container.innerHTML = '';
            new QRCode(container, {
                text: 'Hello World!',
                width: 200,
                height: 200,
                colorDark: '#000000',
                colorLight: '#ffffff',
                correctLevel: QRCode.CorrectLevel.H
            });
        }
        
        function generateTest2() {
            const container = document.getElementById('qr2');
            container.innerHTML = '';
            new QRCode(container, {
                text: 'https://www.baidu.com',
                width: 200,
                height: 200,
                colorDark: '#000000',
                colorLight: '#ffffff',
                correctLevel: QRCode.CorrectLevel.H
            });
        }
        
        function generateTest3() {
            const container = document.getElementById('qr3');
            container.innerHTML = '';
            new QRCode(container, {
                text: '你好，世界！这是一个中文二维码测试。',
                width: 200,
                height: 200,
                colorDark: '#000000',
                colorLight: '#ffffff',
                correctLevel: QRCode.CorrectLevel.H
            });
        }
        
        function generateTest4() {
            const container = document.getElementById('qr4');
            container.innerHTML = '';
            new QRCode(container, {
                text: 'MECARD:N:张三;TEL:13800138000;EMAIL:zhangsan@example.com;;',
                width: 200,
                height: 200,
                colorDark: '#000000',
                colorLight: '#ffffff',
                correctLevel: QRCode.CorrectLevel.H
            });
        }
        
        function generateTest5() {
            const container = document.getElementById('qr5');
            container.innerHTML = '';
            new QRCode(container, {
                text: 'WIFI:T:WPA;S:MyWiFi;P:password123;;',
                width: 200,
                height: 200,
                colorDark: '#000000',
                colorLight: '#ffffff',
                correctLevel: QRCode.CorrectLevel.H
            });
        }
        
        // 页面加载完成后自动生成第一个测试
        window.addEventListener('load', function() {
            generateTest1();
        });
    </script>
</body>
</html>